package cn.DesignModel.adapt;

import jdk.nashorn.internal.runtime.arrays.IteratorAction;

import java.util.Enumeration;
import java.util.Iterator;

/**
 * @author: lizemin
 * @version: 1.0
 */
public class EnumerationAdapter implements Iterator {
    private Enumeration enumeration;

    public EnumerationAdapter(Enumeration enumeration) {
        this.enumeration = enumeration;
    }

    @Override
    public boolean hasNext() {
        return enumeration.hasMoreElements();
    }

    @Override
    public Object next() {
        return enumeration.nextElement();
    }

    @Override
    public void remove() {
        throw new UnsupportedOperationException("remove");
    }


}
